home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Franz PD / Franz PD Disk #279 (1993)(Rhein-Sieg-Soft).zip / Franz PD Disk #279 (1993)(Rhein-Sieg-Soft).adf / ak_gen0-lib_V38.20.LHA / ak_gen0-library / Programmers.LHA / Programmers / AK_GEN0-Lib_Reference.doc next >
Text File  |  1993-07-30  |  25KB  |  1,307 lines

  1.  
  2.    AK_GEN0-Lib_Reference.doc V38.1, 30 July 1993
  3.  
  4.    © 1989-93 by Andreas R. Kleinert. All rights reserved.
  5.  
  6.    Andreas R. Kleinert
  7.    Grube Hohe Grethe 23
  8.    D-57074 Siegen
  9.    Germany
  10.  
  11.  
  12.    Here is a listing of all the functions in the style of the 'RKM' :
  13.  
  14.  
  15.    IMPORTANT NOTE :
  16.  
  17.    All Parameters are STACK-Parameters, because often there are too many
  18.    parameters, which won't fit all into the registers.
  19.    See Doc-File "ReadMe_AK_gen0.txt" for more and detailed information.
  20.  
  21.    If you are not sure, since which version a specific function is first
  22.    available : Use the version number of the Include-File "ak_gen0.h",
  23.    which is "#define"d there.
  24.  
  25. -----------------------------------------------------------------------------
  26.  
  27.    NAME
  28.     AK_Screen
  29.  
  30.    SYNOPSIS
  31.  
  32.     struct Screen * AK_Screen(long l, long t, long w, long h,
  33.                   long d, long dp, long bp, long vm,
  34.                   long ty, struct TextAttr *f,
  35.                   char *title, struct BitMap *cbm);
  36.  
  37.    FUNCTION
  38.  
  39.     Tries to open a Screen, which is described by the given parameters.
  40.  
  41.    INPUT(S)
  42.  
  43.     l, t, w, h - LeftEdge, TopEgde, Width, Height of struct NewScreen
  44.     d       - Depth of struct NewScreen
  45.     dp, bp       - DetailPen, BlockPen of struct NewScreen
  46.     vm       - ViewModes of struct NewScreen
  47.     ty       - Type of struct NewScreen
  48.     f       - Font of struct NewScreen
  49.     title       - DefaultTitle of struct NewScreen
  50.     cbm       - CustomBitMap of struct NewScreen
  51.  
  52.    RESULT
  53.  
  54.     A pointer to a new opened screen or NULL, if opening failed.
  55.  
  56.    WARNING
  57.  
  58.     Test, if the result was NULL, or not !
  59.  
  60.    BUGS
  61.  
  62.     -
  63.  
  64.    SEE ALSO
  65.  
  66.     AK_Window
  67.  
  68. -----------------------------------------------------------------------------
  69.  
  70.    NAME
  71.     AK_Window
  72.  
  73.    SYNOPSIS
  74.  
  75.     struct Window * AK_Window(long l, long t, long w, long h, long d,
  76.                   long b, long idcmp, long flags,
  77.                   struct Gadget *fg, struct Image *cm,
  78.                   char *title, struct Screen *screen,
  79.                   struct BitMap *bm, long minw, long minh,
  80.                   long maxw, long maxh, long type)
  81.  
  82.    FUNCTION
  83.  
  84.     Tries to open a Window, which is described by the given parameters.
  85.  
  86.    INPUT(S)
  87.  
  88.     l, t, w, h - LeftEdge, TopEgde, Width, Height of struct NewWindow
  89.     d, b       - DetailPen, BlockPen of struct NewWindow
  90.     idcmp       - IDCMPFlags of struct NewWindow
  91.     flags       - Flags of struct NewWindow
  92.     fg       - FirstGadget of struct NewWindow
  93.     cm       - CheckMark of struct NewWindow
  94.     title       - Title of struct NewWindow
  95.     screen       - Screen of struct NewWindow
  96.     bm       - BitMap of struct NewWindow
  97.     minw       - MinWidth of struct NewWindow
  98.     minh       - MinHeight of struct NewWindow
  99.     maxw       - MaxWidth of struct NewWindow
  100.     maxh       - MaxHeight of struct NewWindow
  101.     type       - Type of struct NewWindow
  102.  
  103.    RESULT
  104.  
  105.     A pointer to a new opened window or NULL, if opening failed.
  106.  
  107.    WARNING
  108.  
  109.     Test, if the result was NULL, or not !
  110.    BUGS
  111.  
  112.     -
  113.  
  114.    SEE ALSO
  115.  
  116.     AK_Screen
  117.  
  118. -----------------------------------------------------------------------------
  119.  
  120.    NAME
  121.  
  122.     AK_Menu
  123.  
  124.    SYNOPSIS
  125.  
  126.     struct Menu * AK_Menu(struct Menu *next, long l, long w, long flags,
  127.                   char *name, struct MenuItem *item)
  128.  
  129.    FUNCTION
  130.  
  131.     Allocs and fills out a "Menu"-structure.
  132.  
  133.    INPUT(S)
  134.  
  135.     next       - NextMenu of struct Menu
  136.     l       - LeftEdge of struct Menu
  137.     w       - Width of struct Menu
  138.     flags       - Flags of struct Menu
  139.     name       - MenuName of struct Menu
  140.     item       - FirstItem of struct Menu
  141.  
  142.    RESULT
  143.  
  144.     A pointer to an initialized "Menu"-structure or NULL, if failed.
  145.  
  146.    WARNING
  147.  
  148.     a) First initialize the items in reverse order, then the menus in
  149.        reverse order.
  150.  
  151.     b) Test, if the result was NULL, or not !
  152.  
  153.    BUGS
  154.  
  155.     -
  156.  
  157.    SEE ALSO
  158.  
  159.     AK_MenuItem, AK_SubItem
  160.  
  161. -----------------------------------------------------------------------------
  162.  
  163.    NAME
  164.  
  165.     AK_MenuItem
  166.  
  167.    SYNOPSIS
  168.  
  169.     struct MenuItem * AK_MenuItem(struct MenuItem *next, long t, long w,
  170.                       long flags, long me, APTR itfi,
  171.                       APTR sefi, long scut,
  172.                       struct MenuItem * subi)
  173.  
  174.    FUNCTION
  175.  
  176.     Allocs and fills out a "MenuItem"-structure.
  177.  
  178.    INPUT(S)
  179.  
  180.     next       - NextMenu of struct MenuItem
  181.     l       - LeftEdge of struct MenuItem
  182.     t       - TopEdge of struct MenuItem
  183.     w       - Width of struct MenuItem
  184.     flags       - Flags of struct MenuItem
  185.     me       - MutualExclude of struct MenuItem
  186.     itfi       - ItemFill of struct MenuItem
  187.     sefi       - SelectFill of struct MenuItem
  188.     scut       - Command of struct MenuItem
  189.     subi       - SubItem of struct MenuItem
  190.  
  191.    RESULT
  192.  
  193.     A pointer to an initialized "MenuItem"-structure or NULL, if failed.
  194.  
  195.    WARNING
  196.  
  197.     a) First initialize the items in reverse order, then the menus in
  198.        reverse order.
  199.  
  200.     b) Test, if the result was NULL, or not !
  201.  
  202.    BUGS
  203.  
  204.     -
  205.  
  206.    SEE ALSO
  207.  
  208.     AK_Menu, AK_SubItem
  209.  
  210. -----------------------------------------------------------------------------
  211.  
  212.    NAME
  213.  
  214.     AK_SubItem
  215.  
  216.    SYNOPSIS
  217.  
  218.     struct MenuItem * AK_SubItem(struct MenuItem *next, long l, long t,
  219.                      long w, long flags, long me, APTR itfi,
  220.                      APTR sefi, long scut,
  221.                      struct MenuItem *subi)
  222.  
  223.    FUNCTION
  224.  
  225.     Allocs and fills out a "MenuItem"-structure (here used for a SubItem).
  226.  
  227.    INPUT(S)
  228.  
  229.     next       - NextMenu of struct MenuItem
  230.     l       - LeftEdge of struct MenuItem
  231.     t       - TopEdge of struct MenuItem
  232.     w       - Width of struct MenuItem
  233.     flags       - Flags of struct MenuItem
  234.     me       - MutualExclude of struct MenuItem
  235.     itfi       - ItemFill of struct MenuItem
  236.     sefi       - SelectFill of struct MenuItem
  237.     scut       - Command of struct MenuItem
  238.     subi       - SubItem of struct MenuItem
  239.  
  240.    RESULT
  241.  
  242.     A pointer to an initialized "MenuItem"-structure or NULL, if failed.
  243.  
  244.    WARNING
  245.  
  246.     a) SubItems have to be initialized before the main MenuItems.
  247.  
  248.     b) Test, if the result was NULL, or not !
  249.  
  250.    BUGS
  251.  
  252.     -
  253.  
  254.    SEE ALSO
  255.  
  256.     AK_Menu, AK_MenuItem
  257.  
  258. -----------------------------------------------------------------------------
  259.  
  260.    NAME
  261.  
  262.     AK_Gadget
  263.  
  264.    SYNOPSIS
  265.  
  266.     struct Gadget * AK_Gadget(struct Gadget *next, long l, long t, long w,
  267.                   long h, long flags, long act, long type,
  268.                   APTR gadr, APTR selr, struct IntuiText *text,
  269.                   APTR sp, long id)
  270.  
  271.    FUNCTION
  272.  
  273.     Allocs and fills out a "Gadget"-structure.
  274.  
  275.    INPUT(S)
  276.  
  277.     next       - NextMenu of struct Gadget
  278.     l       - LeftEdge of struct Gadget
  279.     t       - TopEdge of struct Gadget
  280.     w       - Width of struct Gadget
  281.     h       - Height of struct Gadget
  282.     flags       - Flags of struct Gadget
  283.     act       - Activation of struct Gadget
  284.     type       - GadgetType of struct Gadget
  285.     gadr       - GadgetRender of struct Gadget
  286.     selr       - SelectRender of struct Gadget
  287.     text       - GadgetText of struct Gadget
  288.     sp       - SpecialInfo of struct Gadget
  289.     id       - GadgetID of struct Gadget
  290.  
  291.    RESULT
  292.  
  293.     A pointer to an initialized "MenuItem"-structure or NULL, if failed.
  294.  
  295.    WARNING
  296.  
  297.     a) Values for GadgetRender, SelectRender, GadgetText, SpecialInfo
  298.        have to be initialized before.
  299.  
  300.     b) Test, if the result was NULL, or not !
  301.  
  302.    BUGS
  303.  
  304.     -
  305.  
  306.    SEE ALSO
  307.  
  308.     AK_Window, AK_Border, AK_IText, AK_StringInfo
  309.  
  310. -----------------------------------------------------------------------------
  311.  
  312.    NAME
  313.  
  314.     AK_StringInfo
  315.  
  316.    SYNOPSIS
  317.  
  318.     struct StringInfo * AK_StringInfo(long groesse, long maximum,
  319.                       struct KeyMap *km)
  320.  
  321.    FUNCTION
  322.  
  323.     Allocs and fills out a "StringInfo"-structure, which is perhaps later
  324.     used with "AK_Gadget".
  325.  
  326.    INPUT(S)
  327.  
  328.     groesse    - Size of the Buffer and the Undo-Buffer used by the
  329.              StringGadget
  330.     maximum    - MaxChars of struct StringInfo
  331.     km       - AltKeyMap of struct StringInfo (normally NULL)
  332.  
  333.    RESULT
  334.  
  335.     A pointer to an initialized "StringInfo"-structure or NULL, if failed.
  336.  
  337.    WARNING
  338.  
  339.     a) The memory with the size "groesse" has to be given free with
  340.        FreeMem later for two times :
  341.        1. StringInfo->Buffer
  342.        2. StringInfo->UndoBuffer
  343.  
  344.     b) Test, if the result was NULL, or not !
  345.  
  346.    BUGS
  347.  
  348.     -
  349.  
  350.    SEE ALSO
  351.  
  352.     AK_Gadget
  353.  
  354. -----------------------------------------------------------------------------
  355.  
  356.    NAME
  357.  
  358.     AK_Border
  359.  
  360.    SYNOPSIS
  361.  
  362.     struct Border * AK_Border(long l, long t, long f, long b, long d,
  363.                   long c, WORD *xy, struct Border *next)
  364.  
  365.    FUNCTION
  366.  
  367.     Allocs and fills out a "Border"-structure, which is perhaps later
  368.     used with "AK_Gadget", "AK_MenuItem", "AK_SubItem" or whereever else.
  369.  
  370.    INPUT(S)
  371.  
  372.     l       - LeftEdge of struct Border
  373.     t       - TopEdge of struct Border
  374.     f       - FrontPen of struct Border
  375.     b       - BackPen of struct Border
  376.     d       - DrawMode of struct Border
  377.     c       - Count of struct Border
  378.     xy       - XY of struct Border
  379.     next       - NextBorder of struct Border
  380.  
  381.    RESULT
  382.  
  383.     A pointer to an initialized "Border"-structure or NULL, if failed.
  384.  
  385.    WARNING
  386.  
  387.     Test, if the result was NULL, or not !
  388.  
  389.    BUGS
  390.  
  391.     -
  392.  
  393.    SEE ALSO
  394.  
  395.     AK_Gadget, AK_MenuItem, AK_SubItem, ...
  396.  
  397. -----------------------------------------------------------------------------
  398.  
  399.    NAME
  400.  
  401.     AK_IText
  402.  
  403.    SYNOPSIS
  404.  
  405.     struct IntuiText * AK_IText(long f, long b, long d, long l, long t,
  406.                     struct TextAttr *font, char *text,
  407.                     struct IntuiText *next)
  408.  
  409.    FUNCTION
  410.  
  411.     Allocs and fills out a "IntuiText"-structure, which is perhaps later
  412.     used with "AK_Gadget", "AK_MenuItem", "AK_SubItem" or whereever else.
  413.  
  414.    INPUT(S)
  415.  
  416.     f       - FrontPen of struct IntuiText
  417.     b       - BackPen of struct IntuiText
  418.     d       - DrawMode of struct IntuiText
  419.     l       - LeftEdge of struct IntuiText
  420.     t       - TopEdge of struct IntuiText
  421.     font       - ITextFont struct IntuiText
  422.     text       - IText of struct IntuiText
  423.     next       - NextText of struct Border
  424.  
  425.    RESULT
  426.  
  427.     A pointer to an initialized "IntuiText"-structure or NULL, if failed.
  428.  
  429.    WARNING
  430.  
  431.     Test, if the result was NULL, or not !
  432.  
  433.    BUGS
  434.  
  435.     -
  436.  
  437.    SEE ALSO
  438.  
  439.     AK_Gadget, AK_MenuItem, AK_SubItem, ...
  440.  
  441. -----------------------------------------------------------------------------
  442.  
  443.    NAME
  444.  
  445.     AK_GfxPrint
  446.  
  447.    SYNOPSIS
  448.  
  449.     void AK_GfxPrint(struct Window *w, char *text, long x, long y)
  450.  
  451.    FUNCTION
  452.  
  453.     Prints out a text under use of the "graphics.library" functions
  454.     "Move" and "Text".
  455.  
  456.    INPUT(S)
  457.  
  458.     w       - a valid pointer to a window, as returned by AK_Window
  459.     text       - a pointer to a null-terminated string
  460.     x       - x-position for the text
  461.     y       - y-position for the text
  462.  
  463.    RESULT
  464.  
  465.     -
  466.  
  467.    WARNING
  468.  
  469.     -
  470.  
  471.    BUGS
  472.  
  473.     -
  474.  
  475.    SEE ALSO
  476.  
  477.     AK_IntuiPrint
  478.     SetAPen, SetBPen (in "graphics.library")
  479.  
  480. -----------------------------------------------------------------------------
  481.  
  482.    NAME
  483.  
  484.     AK_IntuiPrint
  485.  
  486.    SYNOPSIS
  487.  
  488.     void AK_IntuiPrint(struct Window *w, char *text, long x, long y);
  489.  
  490.    FUNCTION
  491.  
  492.     Prints out a text under use of the "intuition.library" function
  493.     "PrintIText".
  494.  
  495.     w       - a valid pointer to a window, as returned by AK_Window
  496.     text       - a pointer to a null-terminated string
  497.     x       - x-position for the text
  498.     y       - y-position for the text
  499.  
  500.    RESULT
  501.  
  502.     -
  503.  
  504.    WARNING
  505.  
  506.     -
  507.  
  508.    BUGS
  509.  
  510.     -
  511.  
  512.    SEE ALSO
  513.  
  514.     AK_GfxPrint
  515.     SetAPen, SetBPen (in "graphics.library")
  516.  
  517. -----------------------------------------------------------------------------
  518.  
  519.    NAME
  520.  
  521.     AK_RefreshDisp
  522.  
  523.    SYNOPSIS
  524.  
  525.     void AK_RefreshDisp(struct Screen *sc, struct Window *w)
  526.  
  527.    FUNCTION
  528.  
  529.     Cleans the Display under use of the follwing functions out of
  530.     "intuition.library" and "graphics.library" :
  531.     "SetRast()"            (Window/Screen)
  532.     "RefreshWindowFrame()" (Window)
  533.     "RefreshGadgets()"     (Window)
  534.  
  535.    INPUT(S)
  536.  
  537.     sc       - a valid pointer to a screen, as returned by AK_Screen
  538.     w       - a valid pointer to a window, as returned by AK_Window
  539.  
  540.    RESULT
  541.  
  542.     -
  543.  
  544.    WARNING
  545.  
  546.     Well, the Display will be erased, so it has to be rewritten with
  547.     the new (or old) information.
  548.     The gadgets and the WindowFrame are both refreshed since V35.102.
  549.  
  550.     Use this functions carefully, because it just refreshes the things,
  551.     of which it thinks, that they _should_ be refreshed ...
  552.  
  553.    BUGS
  554.  
  555.     In former versions there have been some bugs.
  556.     Since V35.102 this function seems to be fully free of bugs.
  557.  
  558.    SEE ALSO
  559.  
  560.     "intuition.library", "graphics.library"
  561.  
  562. -----------------------------------------------------------------------------
  563.  
  564.    NAME
  565.  
  566.     AK_AutoRequester
  567.  
  568.    SYNOPSIS
  569.  
  570.     long AK_AutoRequester(struct Window *w, char *obertext, char *jatext,
  571.                   char *neintext)
  572.  
  573.    FUNCTION
  574.  
  575.     Opens an "AutoRequester", just like in "intuition.library" and gives
  576.     its result back.
  577.  
  578.    INPUT(S)
  579.  
  580.     w       - a valid pointer to a window, as returned by AK_Window
  581.     obertext   - a pointer to a null-terminated string (above text)
  582.     jatext       - a pointer to a null-terminated string (yes-text)
  583.     neintext   - a pointer to a null-terminated string (no-text)
  584.  
  585.    RESULT
  586.  
  587.     (see "intuition.library", AutoRequest)
  588.  
  589.    WARNING
  590.  
  591.     "AutoRequest" uses IntuiTexts. "AK_AutoRequester" just uses strings.
  592.     This is the main difference you shouldn't forget.
  593.  
  594.    BUGS
  595.  
  596.     (see "intuition.library", AutoRequest)
  597.  
  598.    SEE ALSO
  599.  
  600.     (see "intuition.library", AutoRequest)
  601.  
  602. -----------------------------------------------------------------------------
  603.  
  604.    NAME
  605.  
  606.     AK_Alert
  607.  
  608.    SYNOPSIS
  609.  
  610.    long AK_Alert(char *text, long height)
  611.  
  612.    FUNCTION
  613.  
  614.     Displays an Alert at LeftEdge = 100 and TopEdge = 50 under use of the
  615.     "intuition.library" function "DisplayAlert".
  616.  
  617.    INPUT(S)
  618.  
  619.     text       -  a pointer to a null-terminated string (alert text)
  620.     height       - the Height of the alert-"screen"
  621.  
  622.    RESULT
  623.  
  624.     TRUE for LEFT-Button, FALSE for RIGHT-Button.
  625.     Always FALSE for DEADEND_ALERTS, but this functions only produces
  626.     RECOVERY_ALERTS.
  627.  
  628.     (see "intuition.library", DisplayAlert)
  629.  
  630.    WARNING
  631.  
  632.     Be careful. DeadEnd-Alerts never come back.
  633.  
  634.     (see "intuition.library", DisplayAlert)
  635.  
  636.    BUGS
  637.  
  638.     (see "intuition.library", DisplayAlert)
  639.  
  640.    SEE ALSO
  641.  
  642.     (see "intuition.library", DisplayAlert)
  643.  
  644. -----------------------------------------------------------------------------
  645.  
  646.    NAME
  647.  
  648.     AK_FileRequest
  649.  
  650.    SYNOPSIS
  651.  
  652.     char * AK_FileRequest(long xpos, long ypos, struct Screen *fscreen,
  653.                   struct Window *fwindow, long ftype)
  654.  
  655.    FUNCTION
  656.  
  657.     Opens the special "AK_GEN0"-FileRequester, which fully administrates
  658.     itself and just returns a pointer to a string.
  659.     Under OS >= V2.04 the "asl.library" is used for that.
  660.  
  661.    INPUT(S)
  662.  
  663.     x       - x-position for the requester-window
  664.     y       - y-position for the requester-window
  665.     fscreen    - a valid pointer to a screen, as returned by AK_Screen
  666.     fwindow    - a valid pointer to a window, as returned by AK_Window
  667.     ftype       - the Type of the Screen "fscreen" as used with
  668.              "AK_Screen"
  669.  
  670.    RESULT
  671.  
  672.     A pointer to a null-terminated string (FilePath plus -Name).
  673.  
  674.    WARNING
  675.  
  676.     The String has to be given free after use. The length for this is
  677.     defined as "AK_FILEREQ_STRING_LEN" in the Headerfile "AK_GEN0.h".
  678.  
  679.    BUGS
  680.  
  681.     -
  682.  
  683.    SEE ALSO
  684.  
  685.     AK_ReadDir
  686.  
  687. -----------------------------------------------------------------------------
  688.  
  689.    NAME
  690.  
  691.     AK_ReadDir
  692.  
  693.    SYNOPSIS
  694.  
  695.     long AK_ReadDir(char *pathname, char **direntry, long *dirtype)
  696.  
  697.    FUNCTION
  698.  
  699.     This function is mainly used by "AK_FileRequest" to read the contentd
  700.     of directories.
  701.  
  702.    INPUT(S)
  703.  
  704.     pathname   - Path of directory to read
  705.     direntry   - the address of an array of at least 50 char-pointers,
  706.              which all point to a separat 40-character-array (at least)
  707.     direntry   - an array of at least 50 (long) integers, which will be-
  708.              come TRUE for directories and FALSE for files.
  709.              (Other values, which are defined in the Include-File
  710.               are _only_ for PRIVATE use inside the FileRequester.)
  711.  
  712.    RESULT
  713.  
  714.     The number of entries found and read.
  715.  
  716.    WARNING
  717.  
  718.     Don't forget to alloc and the free the arrays !!!
  719.  
  720.    BUGS
  721.  
  722.     -
  723.  
  724.    SEE ALSO
  725.  
  726.     AK_FileRequest
  727.  
  728. -----------------------------------------------------------------------------
  729.  
  730.    NAME
  731.  
  732.     AK_WaitKey
  733.  
  734.    SYNOPSIS
  735.  
  736.     void AK_WaitKey(long rawcode)
  737.  
  738.    FUNCTION
  739.  
  740.     This Function waits for a special (rawcode) key, but not in a multi-
  741.     tasking conform way (direct register access).
  742.  
  743.    INPUT(S)
  744.  
  745.     rawcode    - the RawKey-Code to wait for
  746.  
  747.    RESULT
  748.  
  749.     -
  750.  
  751.    WARNING
  752.  
  753.     Remember ! This is not multitasking-like ! (But its simple :)
  754.  
  755.    BUGS
  756.  
  757.     8)
  758.  
  759.    SEE ALSO
  760.  
  761.     Register : 0xBFEC01
  762.  
  763.        :>
  764.  
  765. -----------------------------------------------------------------------------
  766.  
  767.    NAME
  768.  
  769.     AK_WaitLeft
  770.  
  771.    SYNOPSIS
  772.  
  773.     void AK_WaitLeft(void)
  774.  
  775.    FUNCTION
  776.  
  777.     This Function waits for the left MouseButton, but not in a multi-
  778.     tasking conform way (direct register access).
  779.  
  780.    INPUT(S)
  781.  
  782.     -
  783.  
  784.    RESULT
  785.  
  786.     -
  787.  
  788.    WARNING
  789.  
  790.     Remember ! This is not multitasking-like ! (But its simple :)
  791.  
  792.    BUGS
  793.  
  794.     8)
  795.  
  796.    SEE ALSO
  797.  
  798.     Register : 0xBFE001
  799.  
  800.        :>
  801.  
  802. -----------------------------------------------------------------------------
  803.  
  804.    NAME
  805.  
  806.     AK_GetNum
  807.  
  808.    SYNOPSIS
  809.  
  810.     long AK_GetNum(long min, long max)
  811.  
  812.    FUNCTION
  813.  
  814.     Creates some kind of a random number ... :)
  815.  
  816.    INPUT(S)
  817.  
  818.     min       - the left border for number "X"
  819.     max       - the right border for number "X"
  820.  
  821.    RESULT
  822.  
  823.     number "X" itself.
  824.  
  825.    WARNING
  826.  
  827.     This function runs as long as it produces such number.
  828.  
  829.    BUGS
  830.  
  831.     -
  832.  
  833.    SEE ALSO
  834.  
  835.     -
  836.  
  837. -----------------------------------------------------------------------------
  838.    ADDED IN V36 :
  839. -----------------------------------------------------------------------------
  840.  
  841.    NAME
  842.  
  843.     AK_AllocRequester
  844.  
  845.    SYNOPSIS
  846.  
  847.     APTR AllocRequester(long flag)
  848.  
  849.    FUNCTION
  850.  
  851.     Allocates a special Requester-Structure, whose type and default
  852.     values depend from "flag".
  853.     It may e.g. be used to allocate a FileRequester-Structure for use
  854.     with "AK_ExtFileRequest".
  855.     Modifications of this structure are (in parts) possible.
  856.     Read the Include-File !
  857.  
  858.    INPUT(S)
  859.  
  860.     flag - a flag, which signalizes the type of the structure to
  861.            allocate.
  862.            Example : AK_REQTYPE_FILE for a FileRequester.
  863.            See into the Include-Files for more details.
  864.  
  865.    RESULT
  866.  
  867.     A pointer to a Requester-Structure.
  868.  
  869.    WARNING
  870.  
  871.     The Structure has to be given free after use.
  872.     Just call AK_FreeRequester with its address.
  873.  
  874.    BUGS
  875.  
  876.     -
  877.  
  878.    SEE ALSO
  879.  
  880.     AK_ExtFileRequest, AK_ModeRequest, AK_FreeRequester
  881. -----------------------------------------------------------------------------
  882.  
  883.    NAME
  884.  
  885.     AK_FreeRequester
  886.  
  887.    SYNOPSIS
  888.  
  889.     void FreeRequester(struct AK_Requester *req)
  890.  
  891.    FUNCTION
  892.  
  893.     Delocates the special Requester-Structure, which must have been
  894.     allocated with AK_AllocRequester and may e.g. have been used
  895.     by AK_FileRequester before.
  896.  
  897.    INPUT(S)
  898.  
  899.     req - a pointer to the structure
  900.  
  901.    RESULT
  902.  
  903.     -
  904.  
  905.    WARNING
  906.  
  907.     Never try to delocate things which have not been allocated with
  908.     the corresponding functions.
  909.  
  910.    BUGS
  911.  
  912.     -
  913.  
  914.    SEE ALSO
  915.  
  916.      AK_AllocRequester, AK_ExtFileRequest
  917.  
  918. -----------------------------------------------------------------------------
  919.  
  920.    NAME
  921.  
  922.     AK_ExtFileRequest
  923.  
  924.    SYNOPSIS
  925.  
  926.     char * AK_ExtFileRequest(struct AK_Request *req)
  927.  
  928.    FUNCTION
  929.  
  930.     Opens the special "AK_GEN0"-FileRequester, which fully administrates
  931.     itself and just returns a pointer to a string.
  932.     Under OS >= V2.04 the "asl.library" is used for that.
  933.  
  934.    INPUT(S)
  935.  
  936.     req - a data-structure which contains many information
  937.           about how to construct the Requester.
  938.           Has to be allocated with "AK_AllocRequester".
  939.  
  940.    RESULT
  941.  
  942.     A pointer to a null-terminated string (FilePath plus -Name).
  943.  
  944.    WARNING
  945.  
  946.     The String has to be given free after use. The length for this is
  947.     defined as "AK_FILEREQ_STRING_LEN" in the Headerfile "AK_GEN0.h".
  948.  
  949.    BUGS
  950.  
  951.     -
  952.  
  953.    SEE ALSO
  954.  
  955.     AK_AllocRequester, AK_FreeRequester
  956.  
  957. -----------------------------------------------------------------------------
  958.    ADDED IN V37 :
  959. -----------------------------------------------------------------------------
  960.  
  961.    NAME
  962.  
  963.     AK_GetDirList
  964.  
  965.    SYNOPSIS
  966.  
  967.     struct AK_DirList * AK_GetDirList(char *dirname, APTR reserved)
  968.  
  969.    FUNCTION
  970.  
  971.     This function is mainly used by the FileRequester, but may also
  972.     be used by applications.
  973.     It reads a directory and writes the content in a List of AK_DirEntry
  974.     structures, which then can be read.
  975.     Delocation has to be done with AK_FreeDirList.
  976.  
  977.    INPUT(S)
  978.  
  979.     dirname - name of a directory,
  980.           or NULL to get a list of ASSIGNS and VOLUMES.
  981.  
  982.    RESULT
  983.  
  984.     Pointer to a list of AK_DirEntry-Structures.
  985.  
  986.    WARNING
  987.  
  988.     The List has to be given free after use.
  989.     ONLY use AK_FreeDirList for this.
  990.  
  991.    BUGS
  992.  
  993.     -
  994.  
  995.    SEE ALSO
  996.  
  997.     AK_FreeDirList
  998.  
  999. -----------------------------------------------------------------------------
  1000.  
  1001.    NAME
  1002.  
  1003.     AK_FreeDirList
  1004.  
  1005.    SYNOPSIS
  1006.  
  1007.     void AK_FreeDirList(struct AK_DirList *ak_list)
  1008.  
  1009.    FUNCTION
  1010.  
  1011.     Delocates a list with Directory Contents, which has been
  1012.     allocated and initialized by AK_GetDirList before.
  1013.  
  1014.    INPUT(S)
  1015.  
  1016.     ak_list - a pointer to a list of AK_DirEntry-Structures.
  1017.  
  1018.    RESULT
  1019.  
  1020.     -
  1021.  
  1022.    WARNING
  1023.  
  1024.     Only try to free lists, which have been allocated by AK_GetDirList
  1025.     before.
  1026.  
  1027.    BUGS
  1028.  
  1029.     -
  1030.  
  1031.    SEE ALSO
  1032.  
  1033.     AK_GetDirList
  1034.  
  1035. -----------------------------------------------------------------------------
  1036.  
  1037.    NAME
  1038.  
  1039.     AK_GetModeList
  1040.  
  1041.    SYNOPSIS
  1042.  
  1043.     struct AK_ModeList * AK_GetModeList(void)
  1044.  
  1045.    FUNCTION
  1046.  
  1047.     Writes information about all available Screen-Modes
  1048.     (names, dimensions, etc.) into a linked List.
  1049.  
  1050.    INPUT(S)
  1051.  
  1052.     -
  1053.  
  1054.    RESULT
  1055.  
  1056.     Pointer to a list of AK_ModeEntry-Structures.
  1057.  
  1058.    WARNING
  1059.  
  1060.     The List has to be given free after use.
  1061.     ONLY use AK_FreeModeList for this.
  1062.  
  1063.    BUGS
  1064.  
  1065.     -
  1066.  
  1067.    SEE ALSO
  1068.  
  1069.     AK_FreeModeList
  1070.  
  1071. -----------------------------------------------------------------------------
  1072.  
  1073.    NAME
  1074.  
  1075.     AK_FreeModeList
  1076.  
  1077.    SYNOPSIS
  1078.  
  1079.     void AK_FreeModeList(struct AK_ModeList *modelist)
  1080.  
  1081.    FUNCTION
  1082.  
  1083.     Delocates a linked list with Screen-Mode Information, which has been
  1084.     allocated and initialized by AK_GetModeList before.
  1085.  
  1086.    INPUT(S)
  1087.  
  1088.     ak_list - a pointer to a list of AK_ModeEntry-Structures.
  1089.  
  1090.    RESULT
  1091.  
  1092.     -
  1093.  
  1094.    WARNING
  1095.  
  1096.     Only try to free lists, which have been allocated by AK_GetModeList
  1097.     before.
  1098.  
  1099.    BUGS
  1100.  
  1101.     -
  1102.  
  1103.    SEE ALSO
  1104.  
  1105.     AK_GetModeList
  1106.  
  1107. -----------------------------------------------------------------------------
  1108.  
  1109.    NAME
  1110.  
  1111.     AK_ModeRequest
  1112.  
  1113.    SYNOPSIS
  1114.  
  1115.     struct AK_ModeEntry * AK_ModeRequest(struct AK_Request *req)
  1116.  
  1117.    FUNCTION
  1118.  
  1119.     Opens the special "AK_GEN0"-ModeRequester, which fully administrates
  1120.     itself and just returns a pointer to an AK_ModeEntry-Structure.
  1121.  
  1122.    INPUT(S)
  1123.  
  1124.     req - a data-structure which contains many information
  1125.           about how to construct the Requester.
  1126.           Has to be allocated with "AK_AllocRequester".
  1127.           Free it with "AK_FreeRequester" after use.
  1128.  
  1129.    RESULT
  1130.  
  1131.     A pointer to an AK_ModeEntry-Structure.
  1132.  
  1133.    WARNING
  1134.  
  1135.     The returned structure has to be given free after use.
  1136.     (Use something like : FreeMem(AK_ModeEntry, AK_ModeEntry->Length).
  1137.  
  1138.    BUGS
  1139.  
  1140.     -
  1141.  
  1142.    SEE ALSO
  1143.  
  1144.     AK_AllocRequester, AK_FreeRequester
  1145.  
  1146. -----------------------------------------------------------------------------
  1147.    ADDED IN V38 :
  1148. -----------------------------------------------------------------------------
  1149.  
  1150.    NAME
  1151.  
  1152.     AK_GetMemList
  1153.  
  1154.    SYNOPSIS
  1155.  
  1156.     struct AK_MemList * AK_GetMemList(void)
  1157.  
  1158.    FUNCTION
  1159.  
  1160.     This function is mainly used by the Requesters, but may also
  1161.     be used by applications.
  1162.     It allocates a MemList-Structure, which then can be used with
  1163.     the other memory functions.
  1164.     Delocation has to be done with AK_FreeMemList.
  1165.  
  1166.    INPUT(S)
  1167.  
  1168.     -
  1169.  
  1170.    RESULT
  1171.  
  1172.     Pointer to a list for AK_MemEntry-Structures.
  1173.  
  1174.    WARNING
  1175.  
  1176.     The List has to be given free after use.
  1177.     ONLY use AK_FreeMemList for this.
  1178.  
  1179.    BUGS
  1180.  
  1181.     -
  1182.  
  1183.    SEE ALSO
  1184.  
  1185.     AK_FreeMemList
  1186.  
  1187. -----------------------------------------------------------------------------
  1188.  
  1189.    NAME
  1190.  
  1191.     AK_FreeMemList
  1192.  
  1193.    SYNOPSIS
  1194.  
  1195.     void AK_FreeMemList(struct AK_MemList *ak_list)
  1196.  
  1197.    FUNCTION
  1198.  
  1199.     Delocates a list of AK_MemEntries, which has been allocated
  1200.     with AK_GetMemList() and filled via AK_AddMemEntry() or
  1201.     AK_AllocMemEntry() before.
  1202.  
  1203.    INPUT(S)
  1204.  
  1205.     ak_list - a pointer to a list of AK_MemEntry-Structures.
  1206.  
  1207.    RESULT
  1208.  
  1209.     -
  1210.  
  1211.    WARNING
  1212.  
  1213.     Only try to free lists, which have been allocated by AK_GetMemList
  1214.     before.
  1215.  
  1216.    BUGS
  1217.  
  1218.     -
  1219.  
  1220.    SEE ALSO
  1221.  
  1222.     AK_GetMemList, AK_AddMemEntry, AK_AllocMemEntry
  1223.  
  1224. -----------------------------------------------------------------------------
  1225.  
  1226.    NAME
  1227.  
  1228.     AK_AddMemEntry
  1229.  
  1230.    SYNOPSIS
  1231.  
  1232.     long AK_AddMemEntry(struct AK_MemList *mlist, APTR pointer, long size)
  1233.  
  1234.    FUNCTION
  1235.  
  1236.     Adds a previously allocated piece of memory to the specified
  1237.     AK_MemList.
  1238.  
  1239.    INPUT(S)
  1240.  
  1241.     mlist    - a pointer to a list of AK_MemEntry-Structures.
  1242.     pointer - a pointer to the piece of memory
  1243.     size    - the size of the piece of memory
  1244.  
  1245.    RESULT
  1246.  
  1247.     FALSE, if attempt to allocate the memory failed.
  1248.  
  1249.    WARNING
  1250.  
  1251.     Check the results ALWAYS.
  1252.  
  1253.     NOTE : The specified memory block (pointer, size) will be given
  1254.            free, if an addition to the list is not possible
  1255.            (e.g. because there's not enough memory to allocate
  1256.         another memorylist-entry).
  1257.            This is because error-handling becomes easier this way.
  1258.  
  1259.    BUGS
  1260.  
  1261.     -
  1262.  
  1263.    SEE ALSO
  1264.  
  1265.     AK_GetMemList, AK_FreeMemList, AK_AllocMemEntry
  1266.  
  1267. -----------------------------------------------------------------------------
  1268.  
  1269.    NAME
  1270.  
  1271.     AK_AllocMemEntry
  1272.  
  1273.    SYNOPSIS
  1274.  
  1275.     APTR AK_AllocMemEntry(struct AK_MemList *mlist, ULONG size, ULONG type)
  1276.  
  1277.    FUNCTION
  1278.  
  1279.     Allocates and adds a piece of memory to the specified AK_MemList.
  1280.  
  1281.    INPUT(S)
  1282.  
  1283.     mlist    - a pointer to a list of AK_MemEntry-Structures.
  1284.     size    - the size of the piece of memory
  1285.     type    - the type of piece of memory
  1286.  
  1287.    RESULT
  1288.  
  1289.     Pointer to the piece of memory.
  1290.     NULL, if attempt to allocate the memory failed.
  1291.  
  1292.    WARNING
  1293.  
  1294.     Check the results ALWAYS.
  1295.  
  1296.    BUGS
  1297.  
  1298.     -
  1299.  
  1300.    SEE ALSO
  1301.  
  1302.     AK_GetMemList, AK_FreeMemList, AK_AddMemEntry
  1303.  
  1304. -----------------------------------------------------------------------------
  1305.  
  1306.  
  1307.